home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Presen…tion Library 4 (Reseller)
/
Apple Ref. & Pres. Lib.v4.0.iso
/
5-Fonts & Software
/
Demo Software
/
Wingz
/
Scripts
/
lc
(
.txt
)
< prev
next >
Wrap
Wingz Script
|
1989-02-08
|
4KB
|
116 lines
WNGZWZSC01b1d
Enter amount of Loan in dollars
%Enter annual interest rate in percent
Enter term of loan in months
Enter monthly payment
?You must enter at least 3 numbers to calculate a fourth number!
input
amount
dgask
pymnt
total
input
amount
pymnt
total
intrst
calculateP
define input, amount, int, pymnt, term, total
function amt()
if lc:input = 0
lc:amount = "0"
else
lc:amount = round(c11,0)
lc:amount = dg:dgask("Enter amount of Loan in dollars",lc:amount,15)
repaint off
put value(lc:amount) into c11
repaint on
repaint range c11
unselect
end if
end function
function intrst()
if lc:input = 0
lc:int = "0"
else
lc:int = string(c13*100.0,3)
lc:int = dg:dgask("Enter annual interest rate in percent",lc:int,6)
repaint off
put value(lc:int)/100.0 into c13
repaint on
repaint range c13
unselect
end if
end function
function trm()
if lc:input = 0
lc:term = "0"
else
lc:term = string(c15,0)
lc:term = dg:dgask("Enter term of loan in months",lc:term,6)
repaint off
put value(lc:term) into c15
repaint on
repaint range c15
end if
unselect
end function
function pymt()
if lc:input = 0
lc:pymnt = "0"
else
lc:pymnt = string(c17,2)
lc:pymnt = dg:dgask("Enter monthly payment",lc:pymnt,10)
repaint off
put value(lc:pymnt) into c17
repaint on
repaint range c17
unselect
end if
end function
function calculate()
define n
lc:total = 0
if c11 > 0
lc:total = lc:total + 1
end if
if c13 > 0
lc:total = lc:total + 1
end if
if c15 > 0
lc:total = lc:total + 1
end if
if c17 > 0
lc:total = lc:total + 1
end if
if lc:total < 3
message "You must enter at least 3 numbers to calculate a fourth number!"
elseif (c11>0) and (c13>0) and (c15>0) and (isnumber(c17)=0 or c17 =0)
repaint off
put pmt(c11,c13/12,c15) into c17
select range c17
repaint on
repaint range c17
unselect
elseif (c11>0) and (c13>0) and (c17>0) and (isnumber(c15)=0 or c15=0)
repaint off
put loanterm(c11,c17,c13/12) into c15
select range c15
repaint on
repaint range c15
unselect
elseif (c11>0) and (c15>0) and (c17>0) and (isnumber(c13)=0 or c13=0)
repaint off
put interest(c11,c17,c15)*12 into c13
repaint on
repaint range c13
unselect
elseif (c13>0) and (c15>0) and (c17>0) and (isnumber(c11)=0 or c11=0)
repaint off
put principal(c17,c13/12,c15) into c11
repaint on
repaint range c11
unselect
end if
end function {calculate}